package com.appwoo.txtws.service;

import android.content.Context;
import android.util.Xml;
import com.appwoo.android.exception.NotFoundNetWorkException;
import com.appwoo.android.exception.TimeOutException;
import com.appwoo.android.util.DateHelper;
import com.appwoo.android.util.PullIO;
import com.appwoo.txtws.bean.MessageBean;
import com.appwoo.txtws.bean.RecordInfoBean;
import com.appwoo.txtws.bean.RecordWebBean;
import com.appwoo.txtws.bean.Record_SoftBean;
import com.appwoo.txtws.bean.Record_WebBean;
import com.appwoo.txtws.bean.StateBean;
import com.appwoo.txtws.bean.WebSortBean;
import com.appwoo.txtws.bean.WebSortListBean;
import com.appwoo.txtws.component.GetDateTime;
import com.appwoo.txtws.component.Logger;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.List;
import org.xmlpull.v1.XmlPullParser;
import org.xmlpull.v1.XmlPullParserException;

public class WebService
{
  public MessageBean blackListCommit(String paramString1, String paramString2, String paramString3, Context paramContext)
    throws IOException, XmlPullParserException, TimeOutException, NotFoundNetWorkException
  {
    MessageBean localMessageBean = null;
    MsgService localMsgService = new MsgService();
    String str1 = "<?xml version=\"1.0\" encoding=\"utf-8\" ?><MSG><HEAD><SNDR>" + paramString1 + "</SNDR> <RCVR>SYS</RCVR>" + " <SEQN>1</SEQN><DTTM>" + GetDateTime.getDateTime() + "</DTTM><TYPE>" + "ADUrlRuleSelf</TYPE></HEAD><BODY><BID>" + paramString2 + "</BID><List><UrlBlack>" + paramString3 + "</UrlBlack></List></BODY></MSG>";
    Logger.i("TXTW", "MSG = " + str1);
    String str2 = localMsgService.sendMessage(paramString1, str1, paramContext);
    Object localObject = Xml.newPullParser();
    int i;
    try
    {
      XmlPullParser localXmlPullParser = PullIO.getPullByString(str2);
      localObject = localXmlPullParser;
      i = ((XmlPullParser)localObject).getEventType();
      if (i == 1)
        return localMessageBean;
    }
    catch (NullPointerException localNullPointerException)
    {
      while (true)
        localNullPointerException.printStackTrace();
      switch (i)
      {
      case 1:
      default:
      case 0:
      case 2:
      }
    }
    while (true)
    {
      i = ((XmlPullParser)localObject).next();
      break;
      localMessageBean = new MessageBean();
      continue;
      if (((XmlPullParser)localObject).getName().equalsIgnoreCase("Desc"))
        localMessageBean.setDesc(((XmlPullParser)localObject).nextText());
      else if (((XmlPullParser)localObject).getName().equalsIgnoreCase("Code"))
        localMessageBean.setCode(((XmlPullParser)localObject).nextText());
    }
  }

  public MessageBean blackListGameCommit(String paramString1, String paramString2, String paramString3, String paramString4, String paramString5, String paramString6, String paramString7, String paramString8, String paramString9, Context paramContext)
    throws IOException, XmlPullParserException, TimeOutException, NotFoundNetWorkException
  {
    MessageBean localMessageBean = null;
    MsgService localMsgService = new MsgService();
    String str1 = "<?xml version=\"1.0\" encoding=\"utf-8\" ?><MSG><HEAD><SNDR>" + paramString1 + "</SNDR> <RCVR>SYS</RCVR>" + " <SEQN>1</SEQN><DTTM>" + GetDateTime.getDateTime() + "</DTTM><TYPE>" + "ADGameRuleSelf</TYPE></HEAD><BODY><BID>" + paramString2 + "</BID><List><GameName>" + paramString3 + "</GameName><ProcName>" + paramString4 + "</ProcName>" + "<Author>" + paramString5 + "</Author><UpdateTime>" + paramString6 + "</UpdateTime>" + "<Type>" + paramString7 + "</Type>" + "<Path>" + paramString8 + "</Path>" + "<SHA1>" + paramString9 + "</SHA1>" + "</List></BODY></MSG>";
    Logger.i("TXTW", "MSG = " + str1);
    String str2 = localMsgService.sendMessage(paramString1, str1, paramContext);
    Object localObject = Xml.newPullParser();
    int i;
    try
    {
      XmlPullParser localXmlPullParser = PullIO.getPullByString(str2);
      localObject = localXmlPullParser;
      i = ((XmlPullParser)localObject).getEventType();
      if (i == 1)
        return localMessageBean;
    }
    catch (NullPointerException localNullPointerException)
    {
      while (true)
        localNullPointerException.printStackTrace();
      switch (i)
      {
      case 1:
      default:
      case 0:
      case 2:
      }
    }
    while (true)
    {
      i = ((XmlPullParser)localObject).next();
      break;
      localMessageBean = new MessageBean();
      continue;
      if (((XmlPullParser)localObject).getName().equalsIgnoreCase("Desc"))
        localMessageBean.setDesc(((XmlPullParser)localObject).nextText());
      else if (((XmlPullParser)localObject).getName().equalsIgnoreCase("Code"))
        localMessageBean.setCode(((XmlPullParser)localObject).nextText());
    }
  }

  public List<Record_SoftBean> getRecordGameInfo(String paramString1, String paramString2, String paramString3, int paramInt, Context paramContext)
    throws IOException, XmlPullParserException, TimeOutException, NotFoundNetWorkException
  {
    Record_SoftBean localRecord_SoftBean = null;
    MsgService localMsgService = new MsgService();
    Object localObject1 = null;
    if ((paramString3 == null) || ("".equals(paramString3)))
      paramString3 = DateHelper.getNowDate();
    String str1 = "<?xml version=\"1.0\" encoding=\"utf-8\" ?><MSG><HEAD><SNDR>" + paramString1 + "</SNDR><TYPE>" + "RQGameAccess</TYPE></HEAD><BODY><BID>" + paramString2 + "</BID><DataDate>" + paramString3 + "</DataDate><Allowed>1</Allowed><PageIndex>" + paramInt + "</PageIndex><PageSize>" + 10 + "</PageSize></BODY></MSG>";
    Logger.w("TXTW", "MSG==" + str1);
    String str2 = localMsgService.sendMessage(paramString1, str1, paramContext);
    Logger.w("TXTW", "STR==" + str2);
    Object localObject2 = Xml.newPullParser();
    int i;
    try
    {
      XmlPullParser localXmlPullParser = PullIO.getPullByString(str2);
      localObject2 = localXmlPullParser;
      i = ((XmlPullParser)localObject2).getEventType();
      if (i == 1)
        return localObject1;
    }
    catch (NullPointerException localNullPointerException)
    {
      while (true)
        localNullPointerException.printStackTrace();
      switch (i)
      {
      case 1:
      default:
      case 0:
      case 2:
      case 3:
      }
    }
    while (true)
    {
      i = ((XmlPullParser)localObject2).next();
      break;
      localObject1 = new ArrayList();
      continue;
      if (((XmlPullParser)localObject2).getName().equalsIgnoreCase("List"))
        localRecord_SoftBean = new Record_SoftBean();
      if (localRecord_SoftBean != null)
        if (((XmlPullParser)localObject2).getName().equalsIgnoreCase("ProcName"))
        {
          localRecord_SoftBean.setProcName(((XmlPullParser)localObject2).nextText());
        }
        else if (((XmlPullParser)localObject2).getName().equalsIgnoreCase("Allowed"))
        {
          localRecord_SoftBean.setAllowed(((XmlPullParser)localObject2).nextText());
        }
        else if (((XmlPullParser)localObject2).getName().equalsIgnoreCase("Num"))
        {
          localRecord_SoftBean.setNum(((XmlPullParser)localObject2).nextText());
        }
        else if (((XmlPullParser)localObject2).getName().equalsIgnoreCase("VisitedTime"))
        {
          localRecord_SoftBean.setVisitedTime(((XmlPullParser)localObject2).nextText());
        }
        else if (((XmlPullParser)localObject2).getName().equalsIgnoreCase("Type"))
        {
          localRecord_SoftBean.setType(((XmlPullParser)localObject2).nextText());
        }
        else if (((XmlPullParser)localObject2).getName().equalsIgnoreCase("GameName"))
        {
          localRecord_SoftBean.setGameName(((XmlPullParser)localObject2).nextText());
        }
        else if (((XmlPullParser)localObject2).getName().equalsIgnoreCase("Path"))
        {
          localRecord_SoftBean.setPath(((XmlPullParser)localObject2).nextText());
        }
        else if (((XmlPullParser)localObject2).getName().equalsIgnoreCase("Path1"))
        {
          localRecord_SoftBean.setPath1(((XmlPullParser)localObject2).nextText());
        }
        else if (((XmlPullParser)localObject2).getName().equalsIgnoreCase("Sha1"))
        {
          localRecord_SoftBean.setSha1(((XmlPullParser)localObject2).nextText());
        }
        else if (((XmlPullParser)localObject2).getName().equalsIgnoreCase("Author"))
        {
          localRecord_SoftBean.setAuthor(((XmlPullParser)localObject2).nextText());
          continue;
          if ((((XmlPullParser)localObject2).getName().equalsIgnoreCase("List")) && (localObject1 != null) && (localRecord_SoftBean != null))
          {
            ((List)localObject1).add(localRecord_SoftBean);
            localRecord_SoftBean = null;
          }
        }
    }
  }

  public List<RecordInfoBean> getRecordInfo(String paramString1, String paramString2, String paramString3, int paramInt, Context paramContext)
    throws IOException, XmlPullParserException, TimeOutException, NotFoundNetWorkException
  {
    RecordInfoBean localRecordInfoBean = null;
    MsgService localMsgService = new MsgService();
    Object localObject1 = null;
    if ((paramString3 == null) || ("".equals(paramString3)))
      paramString3 = DateHelper.getNowDate();
    String str1 = "<?xml version=\"1.0\" encoding=\"utf-8\" ?><MSG><HEAD><SNDR>" + paramString1 + "</SNDR><TYPE>" + "RQUrlAccess</TYPE></HEAD><BODY><BID>" + paramString2 + "</BID><DataDate>" + paramString3 + "</DataDate><Allowed>1</Allowed><PageIndex>" + paramInt + "</PageIndex><PageSize>" + 10 + "</PageSize></BODY></MSG>";
    Logger.i("TXTW", "MSG==" + str1);
    String str2 = localMsgService.sendMessage(paramString1, str1, paramContext);
    Object localObject2 = Xml.newPullParser();
    int i;
    try
    {
      XmlPullParser localXmlPullParser = PullIO.getPullByString(str2);
      localObject2 = localXmlPullParser;
      i = ((XmlPullParser)localObject2).getEventType();
      if (i == 1)
        return localObject1;
    }
    catch (NullPointerException localNullPointerException)
    {
      while (true)
        localNullPointerException.printStackTrace();
      switch (i)
      {
      case 1:
      default:
      case 0:
      case 2:
      case 3:
      }
    }
    while (true)
    {
      i = ((XmlPullParser)localObject2).next();
      break;
      localObject1 = new ArrayList();
      continue;
      if (((XmlPullParser)localObject2).getName().equalsIgnoreCase("List"))
        localRecordInfoBean = new RecordInfoBean();
      if (localRecordInfoBean != null)
        if (((XmlPullParser)localObject2).getName().equalsIgnoreCase("Url"))
        {
          localRecordInfoBean.setUrl(((XmlPullParser)localObject2).nextText());
        }
        else if (((XmlPullParser)localObject2).getName().equalsIgnoreCase("Allowed"))
        {
          localRecordInfoBean.setAllowed(((XmlPullParser)localObject2).nextText());
        }
        else if (((XmlPullParser)localObject2).getName().equalsIgnoreCase("Num"))
        {
          localRecordInfoBean.setNum(((XmlPullParser)localObject2).nextText());
        }
        else if (((XmlPullParser)localObject2).getName().equalsIgnoreCase("VisitedTime"))
        {
          localRecordInfoBean.setVisitedTime(((XmlPullParser)localObject2).nextText());
        }
        else if (((XmlPullParser)localObject2).getName().equalsIgnoreCase("Type"))
        {
          localRecordInfoBean.setType(((XmlPullParser)localObject2).nextText());
        }
        else if (((XmlPullParser)localObject2).getName().equalsIgnoreCase("Name"))
        {
          localRecordInfoBean.setName(((XmlPullParser)localObject2).nextText());
        }
        else if (((XmlPullParser)localObject2).getName().equalsIgnoreCase("Path"))
        {
          localRecordInfoBean.setPath(((XmlPullParser)localObject2).nextText());
          continue;
          if ((((XmlPullParser)localObject2).getName().equalsIgnoreCase("List")) && (localObject1 != null) && (localRecordInfoBean != null))
          {
            ((List)localObject1).add(localRecordInfoBean);
            localRecordInfoBean = null;
          }
        }
    }
  }

  public List<Record_WebBean> getTopWrite(String paramString1, String paramString2, String paramString3, int paramInt, Context paramContext)
    throws IOException, XmlPullParserException, TimeOutException, NotFoundNetWorkException
  {
    if ((paramString3 == null) || ("".equals(paramString3)))
      paramString3 = DateHelper.getNowDate();
    Record_WebBean localRecord_WebBean = null;
    MsgService localMsgService = new MsgService();
    Object localObject1 = null;
    String str = localMsgService.sendMessage(paramString1, paramString2, "<?xml version=\"1.0\" encoding=\"utf-8\" ?><MSG><HEAD><SNDR>" + paramString1 + "</SNDR> <RCVR>SYS</RCVR>" + " <SEQN>1</SEQN><DTTM>" + GetDateTime.getDateTime() + "</DTTM><TYPE>" + "RQUrlBrowse</TYPE></HEAD><BODY><DataDate>" + paramString3 + "</DataDate><PageIndex>" + paramInt + "</PageIndex><PageSize>" + 10 + "</PageSize></BODY></MSG>", paramContext);
    Object localObject2 = Xml.newPullParser();
    int i;
    try
    {
      XmlPullParser localXmlPullParser = PullIO.getPullByString(str);
      localObject2 = localXmlPullParser;
      i = ((XmlPullParser)localObject2).getEventType();
      if (i == 1)
      {
        Collections.sort((List)localObject1, new ComparatorNum());
        return localObject1;
      }
    }
    catch (NullPointerException localNullPointerException)
    {
      while (true)
        localNullPointerException.printStackTrace();
      switch (i)
      {
      case 1:
      default:
      case 0:
      case 2:
      case 3:
      }
    }
    while (true)
    {
      i = ((XmlPullParser)localObject2).next();
      break;
      localObject1 = new ArrayList();
      continue;
      if (((XmlPullParser)localObject2).getName().equalsIgnoreCase("List"))
        localRecord_WebBean = new Record_WebBean();
      if (localRecord_WebBean != null)
        if (((XmlPullParser)localObject2).getName().equalsIgnoreCase("Url"))
        {
          localRecord_WebBean.setUrl(((XmlPullParser)localObject2).nextText());
        }
        else if (((XmlPullParser)localObject2).getName().equalsIgnoreCase("Allowed"))
        {
          localRecord_WebBean.setAllowed(((XmlPullParser)localObject2).nextText());
        }
        else if (((XmlPullParser)localObject2).getName().equalsIgnoreCase("Num"))
        {
          localRecord_WebBean.setNum(((XmlPullParser)localObject2).nextText());
        }
        else if (((XmlPullParser)localObject2).getName().equalsIgnoreCase("VisitedTime"))
        {
          localRecord_WebBean.setVisitedTime(((XmlPullParser)localObject2).nextText());
          continue;
          if ((((XmlPullParser)localObject2).getName().equalsIgnoreCase("list")) && (localObject1 != null) && (localRecord_WebBean != null))
          {
            ((List)localObject1).add(localRecord_WebBean);
            localRecord_WebBean = null;
          }
        }
    }
  }

  public WebSortBean getTopWriteSort(String paramString1, String paramString2, String paramString3, int paramInt, Context paramContext)
    throws IOException, XmlPullParserException, TimeOutException, NotFoundNetWorkException
  {
    if ((paramString3 == null) || ("".equals(paramString3)))
      paramString3 = DateHelper.getNowDate();
    WebSortBean localWebSortBean = null;
    MsgService localMsgService = new MsgService();
    ArrayList localArrayList = null;
    WebSortListBean localWebSortListBean = null;
    String str = localMsgService.sendMessage(paramString1, "<?xml version=\"1.0\" encoding=\"utf-8\" ?><MSG><HEAD><SNDR>" + paramString1 + "</SNDR> <RCVR>SYS</RCVR>" + " <SEQN>1</SEQN><DTTM>" + GetDateTime.getDateTime() + "</DTTM><TYPE>" + "RQUrlTypeBrowse</TYPE></HEAD><BODY><BID>" + paramString2 + "</BID><DataDate>" + paramString3 + "</DataDate><PageIndex>" + paramInt + "</PageIndex><PageSize>" + 10 + "</PageSize></BODY></MSG>", paramContext);
    Object localObject = Xml.newPullParser();
    int i;
    try
    {
      XmlPullParser localXmlPullParser = PullIO.getPullByString(str);
      localObject = localXmlPullParser;
      i = ((XmlPullParser)localObject).getEventType();
      if (i == 1)
        return localWebSortBean;
    }
    catch (NullPointerException localNullPointerException)
    {
      while (true)
        localNullPointerException.printStackTrace();
      switch (i)
      {
      case 1:
      default:
      case 0:
      case 2:
      case 3:
      }
    }
    while (true)
    {
      i = ((XmlPullParser)localObject).next();
      break;
      localWebSortBean = new WebSortBean();
      localArrayList = new ArrayList();
      continue;
      if (localWebSortBean != null)
      {
        if (((XmlPullParser)localObject).getName().equalsIgnoreCase("TotalRecord"))
          localWebSortBean.setTotalRecord(((XmlPullParser)localObject).nextText());
        while (true)
        {
          if (localWebSortListBean == null)
            break label332;
          if (!((XmlPullParser)localObject).getName().equalsIgnoreCase("type"))
            break label334;
          localWebSortListBean.setType(((XmlPullParser)localObject).nextText());
          break;
          if (((XmlPullParser)localObject).getName().equalsIgnoreCase("list"))
            localWebSortListBean = new WebSortListBean();
        }
        label332: continue;
        label334: if (((XmlPullParser)localObject).getName().equalsIgnoreCase("num"))
        {
          localWebSortListBean.setNum(((XmlPullParser)localObject).nextText());
          continue;
          if ((localArrayList != null) && (localWebSortListBean != null))
          {
            if (((XmlPullParser)localObject).getName().equalsIgnoreCase("list"))
            {
              localArrayList.add(localWebSortListBean);
              localWebSortListBean = null;
            }
          }
          else if ((((XmlPullParser)localObject).getName().equalsIgnoreCase("MSG")) && (localWebSortBean != null) && (localArrayList != null))
          {
            Collections.sort(localArrayList, new ComparatorSortNum());
            localWebSortBean.setList(localArrayList);
          }
        }
      }
    }
  }

  public List<RecordWebBean> getUrlByType(String paramString1, String paramString2, String paramString3, String paramString4, int paramInt, Context paramContext)
    throws IOException, XmlPullParserException, TimeOutException, NotFoundNetWorkException
  {
    RecordWebBean localRecordWebBean = null;
    MsgService localMsgService = new MsgService();
    Object localObject1 = null;
    if ((paramString4 == null) || ("".equals(paramString4)))
      paramString4 = DateHelper.getNowDate();
    String str = localMsgService.sendMessage(paramString1, "<?xml version=\"1.0\" encoding=\"utf-8\" ?><MSG><HEAD><SNDR>" + paramString1 + "</SNDR> <RCVR>SYS</RCVR>" + " <SEQN>1</SEQN><DTTM>" + GetDateTime.getDateTime() + "</DTTM><TYPE>" + "RQUrlBrowseByType</TYPE></HEAD><BODY><BID>" + paramString2 + "</BID><DataDate>" + paramString4 + "</DataDate><UrlType>" + paramString3 + "</UrlType><Allowed>2</Allowed><PageIndex>" + paramInt + "</PageIndex><PageSize>" + 10 + "</PageSize></BODY></MSG>", paramContext);
    Object localObject2 = Xml.newPullParser();
    int i;
    try
    {
      XmlPullParser localXmlPullParser = PullIO.getPullByString(str);
      localObject2 = localXmlPullParser;
      i = ((XmlPullParser)localObject2).getEventType();
      if (i == 1)
        return localObject1;
    }
    catch (NullPointerException localNullPointerException)
    {
      while (true)
        localNullPointerException.printStackTrace();
      switch (i)
      {
      case 1:
      default:
      case 0:
      case 2:
      case 3:
      }
    }
    while (true)
    {
      i = ((XmlPullParser)localObject2).next();
      break;
      localObject1 = new ArrayList();
      continue;
      if (((XmlPullParser)localObject2).getName().equalsIgnoreCase("List"))
        localRecordWebBean = new RecordWebBean();
      if (localRecordWebBean != null)
        if (((XmlPullParser)localObject2).getName().equalsIgnoreCase("Url"))
        {
          localRecordWebBean.setUrl(((XmlPullParser)localObject2).nextText());
        }
        else if (((XmlPullParser)localObject2).getName().equalsIgnoreCase("Num"))
        {
          localRecordWebBean.setNum(((XmlPullParser)localObject2).nextText());
          continue;
          if ((((XmlPullParser)localObject2).getName().equalsIgnoreCase("List")) && (localObject1 != null) && (localRecordWebBean != null))
          {
            ((List)localObject1).add(localRecordWebBean);
            localRecordWebBean = null;
          }
        }
    }
  }

  public StateBean isAddLocation(String paramString1, String paramString2, Context paramContext)
    throws IOException, XmlPullParserException, TimeOutException, NotFoundNetWorkException
  {
    StateBean localStateBean = new StateBean();
    String str = new MsgService().sendMessage(paramString1, "<?xml version=\"1.0\" encoding=\"utf-8\" ?><MSG><HEAD><SNDR>" + paramString1 + "</SNDR><TYPE>" + "RQCmdLocation</TYPE></HEAD><BODY><BID>" + paramString2 + "</BID></BODY></MSG>", paramContext);
    Object localObject = Xml.newPullParser();
    int i;
    try
    {
      XmlPullParser localXmlPullParser = PullIO.getPullByString(str);
      localObject = localXmlPullParser;
      i = ((XmlPullParser)localObject).getEventType();
      if (i == 1)
        return localStateBean;
    }
    catch (NullPointerException localNullPointerException)
    {
      while (true)
        localNullPointerException.printStackTrace();
      switch (i)
      {
      case 1:
      default:
      case 0:
      case 2:
      }
    }
    while (true)
    {
      i = ((XmlPullParser)localObject).next();
      break;
      localStateBean = new StateBean();
      continue;
      if (((XmlPullParser)localObject).getName().equalsIgnoreCase("Type"))
        localStateBean.setType(((XmlPullParser)localObject).nextText());
    }
  }

  public class ComparatorNum
    implements Comparator
  {
    public ComparatorNum()
    {
    }

    public int compare(Object paramObject1, Object paramObject2)
    {
      Record_WebBean localRecord_WebBean1 = (Record_WebBean)paramObject1;
      Record_WebBean localRecord_WebBean2 = (Record_WebBean)paramObject2;
      if (Integer.parseInt(localRecord_WebBean1.getNum()) > Integer.parseInt(localRecord_WebBean2.getNum()))
        return -1;
      return 0;
    }
  }

  public class ComparatorSortNum
    implements Comparator
  {
    public ComparatorSortNum()
    {
    }

    public int compare(Object paramObject1, Object paramObject2)
    {
      WebSortListBean localWebSortListBean1 = (WebSortListBean)paramObject1;
      WebSortListBean localWebSortListBean2 = (WebSortListBean)paramObject2;
      if (Integer.parseInt(localWebSortListBean1.getNum()) > Integer.parseInt(localWebSortListBean2.getNum()))
        return -1;
      return 0;
    }
  }
}

/* Location:           C:\Documents and Settings\Administrator\classes_dex2jar.jar
 * Qualified Name:     com.appwoo.txtws.service.WebService
 * JD-Core Version:    0.6.2
 */